package com.lzh.educms.controller;
import com.lzh.commonutils.CommonResult;
import com.lzh.educms.entity.CrmBanner;
import com.lzh.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * 前台
 */
@RestController
@CrossOrigin
@RequestMapping("/eduCms/front")
public class FrontBannerController {
    @Autowired
    private CrmBannerService crmBannerService;

    /**
     * 获取轮播图
     * @return
     */
    @GetMapping("/getBanner")
    public CommonResult getBanner() {
        List<CrmBanner> list = crmBannerService.selectAllBanner();
        return CommonResult.ok().data("list",list);
    }
}
